import { createModule } from '@/router/type'
import LayoutView from '@/layout/LayoutView.vue'

export default createModule([
  {
    path: '/data',
    redirect: '/data/device',
    component: LayoutView,
    meta: {
      icon: import('~icons/menu/data'),
      title: '数据'
    },
    children: [
      {
        path: 'device',
        name: 'DeviceData',
        meta: { title: '设备数据' },
        component: () => import('@views/device/device-data/index.vue'),
        children: [
          {
            path: 'realtime',
            name: 'DeviceRealtime',
            meta: { title: '实时数据' },
            component: () => import('@views/device/device-data/realtime-data.vue')
          },
          {
            path: 'history',
            name: 'DeviceHistoryData',
            meta: { title: '历史数据' },
            component: () => import('@views/device/device-data/history-data.vue')
          },
          {
            path: 'alarm',
            name: 'DeviceAlarmRecord',
            meta: { title: '报警记录' },
            component: () => import('@views/device/device-data/alarm-record.vue')
          },
          {
            path: 'log',
            name: 'DeviceLog',
            meta: { title: '设备日志' },
            component: () => import('@views/device/device-data/device-log.vue')
          }
        ]
      },
      {
        path: 'device-share',
        name: 'DeviceShare',
        meta: { title: '设备分享', isMenu: false },
        component: () => import('@views/device/share/device-share.vue')
      },
      {
        path: 'custom-report',
        name: 'CustomReport',
        meta: { title: '自定义报表' },
        component: () => import('@views/report/custom-report.vue')
      },
      {
        path: 'self-config-manage',
        name: 'SelfConfigManage',
        meta: { title: '组态画面' },
        component: () => import('@views/self-config/self-config-manage.vue')
      },
      {
        path: 'historical-data',
        name: 'RemoveHistoricalData',
        meta: { title: '数据清理' },
        component: () => import('@views/historical-data/remove-historical-data.vue')
      },
      {
        path: 'self-share-list',
        name: 'SelfShareList',
        meta: { title: '组态分享列表', isMenu: false },
        component: () => import('@views/self-config/share/share-list.vue')
      }
    ]
  }
], true)
